<?php 
	$payment = mysqld_select("SELECT id FROM " . table('payment') . " WHERE  enabled=1 and code='cash' and beid=:beid limit 1",array(":beid"=>$GLOBALS['_CMS']['beid']));
    if(empty($payment['id']))
    {
      message("未开启货到付款功能");	
      }
						$member=member_get($openid);

			pdo_update("eshop_order", array(
            "paytype" => 3
        ), array(
            "id" => $order["id"]
        ));
//==strart==
$return_result=order_finish("cash",3,$order["id"]);
      if($return_result)
      {
      	  message("货到付款成功",create_url('mobile',array('do'=>'order','act'=>'list','m'=>'eshop')),'success');        
      }else
      {
      	  message("货到付款失败，请重试",create_url('mobile',array('do'=>'order','act'=>'list','m'=>'eshop')),'error');        
     
      }

?>